// const proxy = require("../config/proxy");
const { createProxyMiddleware } = require("http-proxy-middleware");
const a = require("../config/proxy");

module.exports = function (app) {
  for (const key in a.proxy) {
    app.use(
      createProxyMiddleware(key, {
        target: a.proxy[key]["target"],
        changeOrigin: a.proxy[key]["changeOrigin"],
        pathRewrite: a.proxy[key]["pathRewrite"],
      })
    );
  }
};
